import Vue from 'vue';
import ElementUI from 'element-ui';
import VCharts from 'v-charts';
import ECharts from 'vue-echarts';
import axios from 'axios';
import VueAxios from 'vue-axios';

import { library } from '@fortawesome/fontawesome-svg-core';
import { fas } from '@fortawesome/free-solid-svg-icons';
import { fab } from '@fortawesome/free-brands-svg-icons';
import {
  FontAwesomeIcon,
  FontAwesomeLayers,
  FontAwesomeLayersText,
} from '@fortawesome/vue-fontawesome';
import App from './App.vue';
import router from './router';
import store from './store';
import 'element-ui/lib/theme-chalk/index.css';

Vue.config.productionTip = false;

Vue.use(ElementUI);
Vue.use(VCharts);
Vue.use(VueAxios, axios);

library.add(fas);
library.add(fab);

Vue.component('v-chart', ECharts);
Vue.component('font-awesome-icon', FontAwesomeIcon);
Vue.component('font-awesome-layers', FontAwesomeLayers);
Vue.component('font-awesome-layers-text', FontAwesomeLayersText);

axios.defaults.baseURL = 'http://localhost:8000';

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app');

// 全局公共函数
